%include "io.inc"

section .bss
    N equ 5
    arr resd N ; reserve N dword, total N*4 Bytes

section .text
global main
main:
    ;; 1.读取数组
    ;; ecx = N, ebx = 0
    mov ecx, N
    xor ebx, ebx
cycle_fill:
    ;; arr[ebx++] = read_num()
    GET_DEC 4, [arr + 4 * ebx]
    inc ebx
    ;; while (ecx-- > 0)
    loop cycle_fill

    ;; 2.打印数组
    ;; ecx = N, ebx = 0
    mov ecx, N
    xor ebx, ebx
cycle_print:
    ;; print(arr[ebx++])
    PRINT_DEC 4, [arr + 4 * ebx]
    inc ebx
    ;; while (ecx-- > 0)
    loop cycle_print

    xor eax, eax
    ret